<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Home</title>
</head>
<body>

<h1>主页</h1>

<a href="shoppingCart.jsp">购物车</a>

<table>
<table>
	<tr><th>ID</th><th>bookName</th><th>price</th><th>picture</th></tr>	
	<c:forEach var="b" items="${books}">
		<tr>
			<td>${b.bid}</td>
			<td>${b.bname }</td>
			<td><fmt:formatNumber value="${b.price }" pattern="$##,###.00"></fmt:formatNumber></td>
			<td><img src="${b.picture }"></td>
			<td><a href="AddToShoppingCart?bid=${b.bid}&bname=${b.bname}&price=${b.price }&picture=${b.picture }">Add</a></td>
		</tr>
	</c:forEach>
	
</table>
</table>
</body>
</html>